package spms.data.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import spms.data.entity.Icon;
import spms.data.service.IconService;

@Controller
public class IconController {

    @Autowired
    IconService iconService;

    @RequestMapping("/icon/findAll")
    @ResponseBody
    public Object findAll() throws Exception {
        return iconService.findAll(Icon.class);
    }

    @RequestMapping("/icon/findPage")
    @ResponseBody
    public Object findPage(int pageNum, int pageSize) throws Exception {
        return iconService.findPage(pageNum,pageSize,Icon.class);
    }

    @RequestMapping("/icon/addIcon")
    @ResponseBody
    public Object addIcon(Icon icon){
        return iconService.addIcon(icon);
    }
}
